#!/bin/bash
#variables

ip_txt_path=/Users/suoxiaopeng/Sites/ai-api/china_ip.txt;
ip_url='http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest';

#download

/usr/bin/curl ${ip_url} | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' >${ip_txt_path}
#parse 2 redis
echo "begin parse ip\n";


